package com.weixing.mall.util.logistics;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;


/**
 * @author ceshi
 * @Title: ${file_name}
 * @Package ${package_name}
 * @Description: ${todo}
 * @date 2020/1/1411:35
 */
public class LogisticsQuery {

    public static final String APPKEY = "591a8776226ad6a7";// 你的appkey
    public static final String URL = "https://api.jisuapi.com/express/query";
    public static final String type = "auto";

    /**
     * 获取物流信息，status!=0,前端只需要展示msg即可，结果status=0为查询返回数据，前端展示result数据，json格式数据如下，
     *{
     * 	"status": 0,
     * 	"msg": "ok",
     * 	"result": {
     * 		"number": "75328275112813",
     * 		"type": "zto",
     * 		"typename": "中通速递",
     * 		"logo": "https:\/\/api.jisuapi.com\/express\/static\/images\/logo\/80\/zto.png",
     * 		"list": [{
     * 			"time": "2020-01-14 11:42:13",
     * 			"status": "【福州市】  快件离开 【福州中转】 已发往 【福清】"
     *                }],
     * 		"deliverystatus": 1,
     * 		"issign": 0    * 	}
     * }
     * @param number
     * @return
     */
    public static String getLogistics(String number) {
        String result = null;
        String url = URL + "?appkey=" + APPKEY + "&type=" + type + "&number=" + number;

        try {
            result = HttpClientUtil.get(url);
            System.out.println(result);

        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

}
